unit ReportRDM;

{$WARN SYMBOL_PLATFORM OFF}

interface

uses
  Windows, Messages, SysUtils, Classes, ComServ, ComObj, VCLCom, DataBkr,
  DBClient, PoslovanjeSrv_TLB, StdVcl, BaseRDM, FMTBcd, Provider,
  alProvider, DB, SqlExpr;

type
  TrdmReport = class(TrdmBase, IrdmReport)
  private

  protected
    class procedure UpdateRegistry(Register: Boolean; const ClassID, ProgID: string); override;
    procedure RefreshRecord(const Session: ISession;
      const ProviderName: WideString; ID: Integer); safecall;
    procedure Renumber(const Session: ISession; const FieldName,
      SortFieldName: WideString; StartValue, EndValue: Integer); safecall;
    procedure Set_ReadOnly(Param1: WordBool); safecall;
    procedure Set_SQLConnection(Param1: Integer); safecall;
  public
    constructor Create(AOwner: TComponent); override;
  end;

var
  ReportFactory: TComponentFactory;

implementation

{$R *.DFM}

constructor TrdmReport.Create(AOwner: TComponent);
begin
  inherited;
  dspMain.Options := dspMain.Options + [poReadOnly];
end;

procedure TrdmReport.RefreshRecord(const Session: ISession;
  const ProviderName: WideString; ID: Integer);
begin
  inherited;
end;

procedure TrdmReport.Renumber(const Session: ISession; const FieldName,
  SortFieldName: WideString; StartValue, EndValue: Integer);
begin
  inherited;
end;

procedure TrdmReport.Set_ReadOnly(Param1: WordBool);
begin
  inherited;
end;

procedure TrdmReport.Set_SQLConnection(Param1: Integer);
begin
  inherited;
end;

class procedure TrdmReport.UpdateRegistry(Register: Boolean; const ClassID, ProgID: string);
begin
  if Register then
  begin
    inherited UpdateRegistry(Register, ClassID, ProgID);
    EnableSocketTransport(ClassID);
    EnableWebTransport(ClassID);
  end else
  begin
    DisableSocketTransport(ClassID);
    DisableWebTransport(ClassID);
    inherited UpdateRegistry(Register, ClassID, ProgID);
  end;
end;

initialization
  ReportFactory := TComponentFactory.Create(ComServer, TrdmReport,
    Class_rdmReport, ciInternal, tmApartment);
end.
